//
//  NetMessageTools.m
//  TheRicher
//
//  Created by 李晓东 on 2018/2/3.
//  Copyright © 2018年 PeanutXu. All rights reserved.
//

#import "NetMessageTools.h"
#import "ShuangSeQiu.h"

@implementation NetMessageTools
+ (NSArray *)changeIntoShuangSeQiu:(id)obj{
    NSMutableArray *resultMutableArray = [NSMutableArray arrayWithCapacity:2];
    
    NSDictionary *dict = (NSDictionary *)obj;
    if (((NSDictionary *)dict[@"result"])[@"list"] != nil) {
        NSArray *array = ((NSDictionary *)dict[@"result"])[@"list"];
        for (id tempObj in array) {
            
            NSDictionary *tempDict = (NSDictionary *)tempObj;
            ShuangSeQiu *doubleChromosphere = [ShuangSeQiu shuangSeQiuWithDictFromServer:tempDict];
            [resultMutableArray addObject:doubleChromosphere];
        }
    } else if (((NSDictionary *)dict[@"result"])[@"list"] == nil) {
        NSDictionary *tempDict = ((NSDictionary *)dict[@"result"]);
        ShuangSeQiu *doubleChromosphere = [ShuangSeQiu shuangSeQiuWithDictFromServer:tempDict];
        [resultMutableArray addObject:doubleChromosphere];
    }
    
    return resultMutableArray;
}
@end
